package com.sk.skplanet.commute.actions;

import com.sk.skplanet.commute.controllers.MyApplication;

public class Actions {

	private static final float DEFAULT_HDIP_DENSITY_SCALE = 1.5f;

	public static int PixelFromDP(int DP) {
		float scale = MyApplication.getAppContext().getResources()
				.getDisplayMetrics().density;
		return (int) (DP / scale * DEFAULT_HDIP_DENSITY_SCALE);
	}

	public static int DPFromPixel(int pixel) {

		float scale = MyApplication.getAppContext().getResources()
				.getDisplayMetrics().density;
		return (int) (pixel / DEFAULT_HDIP_DENSITY_SCALE * scale);
	}
}
